package com.second.app.thread.join.join_releaselock;

/**
 * @author gyz
 * @date 2021/1/28 14:28
 */
public class AA extends Thread {
    private BB b;

    public AA(BB b) {
        this.b = b;
    }

    @Override
    public void run() {
        try {
            synchronized (b) {
                b.start();
                b.join();//证明join释放锁
                for (int i = 0; i < Integer.MAX_VALUE; i++) {
                    Math.random();
                }
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
